package com.wc.AlgoOJ.LQ1443_飞机降落;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/27 22:03
 * @description http://43.138.190.70:8888/p/LQ1443
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 15;
    static int[][] a = new int[N][3];
    static boolean[] st = new boolean[N];
    static int t, n;
    static boolean isFill;

    public static void main(String[] args) {
        t = sc.nextInt();
        while (t-- > 0) {
            n = sc.nextInt();
            for (int i = 1; i <= n; i++) {
                for (int j = 0; j < 3; j++) {
                    a[i][j] = sc.nextInt();
                }
            }
            isFill = false;
            dfs(0, 0);
            out.println(isFill ? "YES" : "NO");
        }
        out.flush();
    }

    static void dfs(int u, int lastTime) {
        // 全部都满足要求了
        if (u == n) {
            isFill = true;
            return;
        }
        for (int i = 1; i <= n; i++) {
            if (!st[i] && a[i][0] + a[i][1] >= lastTime) {
                st[i] = true;
                dfs(u + 1, Math.max(lastTime, a[i][0]) + a[i][2]);
                st[i] = false;
            }
        }
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
